export const getUserOsInfo = () => {
  const userAgent = navigator.userAgent;
    if (userAgent.indexOf("Windows NT 10.0") !== -1) return "#icon-windows";
    if (userAgent.indexOf("Windows NT 6.2") !== -1) return "#icon-windows";
    if (userAgent.indexOf("Windows NT 6.1") !== -1) return "#icon-windows";
    if (userAgent.indexOf("Windows NT 6.0") !== -1) return "#icon-windows";
    if (userAgent.indexOf("Windows NT 5.1") !== -1) return "#icon-windows";
    if (userAgent.indexOf("Windows NT 5.0") !== -1) return "#icon-windows";
    if (userAgent.indexOf("Mac") !== -1) return "#icon-ios";
    if (userAgent.indexOf("X11") !== -1) return "#icon-unix";
    if (userAgent.indexOf("Linux") !== -1) return "#icon-linux";
    return "Other";
}
export const getBrowserType = () => {
  let ua = navigator.userAgent.toLocaleLowerCase()
  let browserType = null
  if (ua.match(/msie/) != null || ua.match(/trident/) != null) {
    browserType = '#icon-IE'
  } else if (ua.match(/firefox/) != null) {
    browserType = '#icon-mozilla-firefox-logologotypus2'
  } else if (ua.match(/ucbrowser/) != null) {
    browserType = '#icon-UCliulanqi'
  } else if (ua.match(/opera/) != null || ua.match(/opr/) != null) {
    browserType = '#icon-opera'
  } else if (ua.match(/bidubrowser/) != null) {
    browserType = '#icon-baidu1'
  } else if (ua.match(/metasr/) != null) {
    browserType = '#icon-sougou'
  } else if (ua.match(/tencenttraveler/) != null || ua.match(/qqbrowse/) != null) {
    browserType = '#icon-QQliulanqi'
  } else if (ua.match(/maxthon/) != null) {
    browserType = '#icon-ieliulanqi'
  } else if(ua.match(/edg/) != null){
    browserType = '#icon-Edge-01'
  } else if(ua.match(/wow/)!= null){
    browserType = '#icon-icon-360'
  }else if (ua.match(/chrome/) != null) {
      browserType = '#icon-chrome'
  }  else if (ua.match(/safari/) != null) {
    browserType = '#icon-Safari'
  } else {
    browserType = '#icon-nginx'
  }
  return browserType
}
export const getDataTime = () =>{
  let date = new Date()
  let year = date.getFullYear()
  let mon = date.getMonth()
  let da = date.getDate()
  return `${year}-${mon<9? '0'+ (mon+1):mon+1}-${da<10 ? '0' + da : da}`
}
